package com.dvhung.controller;

import com.dvhung.common.ActionEvent;
import com.dvhung.constants.Constants;
import com.dvhung.model.utils.ItemModel;
import com.dvhung.projectmvcdemo.MainActivity;

public class ItemController {
	private static ItemController instance;
	public static ItemController getInstance(){
		if(instance == null)
			instance = new ItemController();
		return instance;
	}
	public void handleViewEvent(ActionEvent e){
		switch (e.action) {
		case Constants.GET_ITEM:
			ItemModel.getInstance().handleControllerEvent(e);
			break;

		default:
			break;
		}
	}
	public void handleModelViewEvent(ActionEvent e){
		switch (e.action) {
		case Constants.GET_ITEM:
			MainActivity sender = (MainActivity)e.sender;
			sender.handleControllerViewEvent(e);
			break;

		default:
			break;
		}
	}
}
